package jdbc.day2.demo2_limit;

import jdbc.day1.demo2_操作.Stu;
import tmp.Tmp;

import java.util.List;

public class A {
    public static void main(String[] args) throws Exception{
        query(4,3);
    }

    static void query(int pageNo,int pageSize)throws Exception{
        List<Stu> list= Tmp.query("select * from stu limit ?,?",
                rs->new Stu(rs.getInt("s_id"),rs.getString("sname")),
        (pageNo-1)*pageSize,pageSize);
        System.out.println(list);
    }
}
